<?php
class PrimaryKeysFilterIterator extends FilterIterator {
	public function __construct(ArrayObject $values) {
		parent::__construct($values->getIterator());
	}
	
	public function accept() {
		return parent::current()->field->isPK;
	}
	
	public function toArray($useKeys = true) {
		return iterator_to_array($this, $useKeys);
	}
	
	public function __get($name) {
		if($name == 'types') {
			$types = '';
			foreach($this as $value)
				$types .= parent::current()->field->getStatementType();
			return $types;
		}
	}
	
	public function current() {
		return parent::current()->value;
	}
	
	public function next() {
		if(parent::next())
			return parent::current()->value;
	}
}
?>